// math_cos.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "math_cosh.h"
#include <math.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

mathOper::mathOper()
{
	m_strOper = "cosh";
	m_strGapLeft = "(";
	m_StrGapRight = ")";
	SetOperAtribute();
}

mathOper::~mathOper()
{

}

void mathOper::SetOperAtribute()
{
	m_Attribute.unit = UNITARY;
	m_Attribute.priority = LEVEL_THIRD;
	m_Attribute.type = OPERATOR;
}

void mathOper::Release()
{
	delete this;
}

void mathOper::Evaluate( double* dbDatas,int nCount )
{
	if(nCount==1)
	{
		m_dbResult = cosh(*dbDatas);
	}
	else
	{
		TRACE("the Count of Operands \"cos\" wrong");
	}
}

BOOL  __stdcall CreatePlugObj(void** pPlugObj)
{
	*pPlugObj= new mathOper; 
	return *pPlugObj != NULL;
}

void ReleasePlugObj(mathOper* pPlugObj)
{
	delete pPlugObj;
	pPlugObj = NULL;
}